/*
 * Copyright (C) 2010 Johan Waldeback
 *  
 * This file is part of the OpenFMS project (http://www.openfms-project.org)
 * 
 * OpenFMS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef __GRAPHDATASET_H__
#define __GRAPHDATASET_H__

#include <wx/wx.h>
#include <wx/list.h>

/**
 * \class GraphDataSet
 * \brief Class that stores a set of data points
 *
 * GraphDataSet stores a list of 2D coordinates in two formats. 
 * One format contains tha real/actual data poits. These are store in 
 * two lists of equal length. One containing the x-values, and the other the y-values.
 * The other format, representing the same points, are scaled to screen coorinates.
 *
 * The intended usage is as a data point storage for a visual control:
 * The actual data are stored, but also the same data in screen coordinates.
 * The screen coordinates only has to be re-scaled when the visual control re-sizes.  
 */


class GraphDataSet
{
private:
	float *m_pX;        /**< Pointer to array with x data points */
	float *m_pY;        /**< Pointer to array with y data points */
	size_t m_count;     /**< Number of (x,y) coordinated stored. I.e. length of the array pointed to by m_pX, and m_pY **/
	wxPointList m_wxPointList; /**< List of data points scaled to sceen cordinates */
	void setWxPointListLength(size_t length);
public:
	GraphDataSet();
	GraphDataSet( const float *pX, const float *pY, size_t count );
	void setData( const float *pX, const float *pY, size_t count );
	~GraphDataSet();
	float getMaxAbsX();
	float getMaxAbsY();
	wxPointList *getScaledWxPointList( float scaleX, float scaleY );
};

#endif // __GRAPHDATASET_H__
